package com.ak.game.entity.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Objects;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class BetReqVo {

    /**
     * msg_id
     */
    private String msgId;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 下注的数据
     */
    private Integer betType;

    /**
     * 下注金额
     */
    private BigDecimal amount;

    /**
     * 场次
     */
    private String gameTime;

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        BetReqVo other = (BetReqVo) obj;
        return Objects.equals(msgId, other.msgId) &&
                Objects.equals(userId, other.userId) &&
                Objects.equals(betType, other.betType) &&
                Objects.equals(gameTime, other.gameTime) &&
                Objects.equals(amount.stripTrailingZeros(), other.amount.stripTrailingZeros());
    }

    @Override
    public int hashCode() {
        return Objects.hash(msgId, userId, betType, amount, gameTime);
    }

}
